#!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib,urllib2,re,os,cookielib,xbmc

#author:
#FreaX
#
#version: 0.1
#date: 20100506

def check(url):
	if url.rfind("dataup"): 
		return 1
	else:
		return 0

def get_regexp():
	return "(http://[w]*\.?dataup.(?:to|de)/[0-9]*/[^/<>]*.)"
def get_name():
	return "dataup"
def join(id):
	return id
	
def get_link1(url):
	BASE_PATH = os.getcwd().replace( ";", "" )
	BASE_DATA_PATH = os.path.join( xbmc.translatePath("special://profile/plugin_data/hoster"), "oracle2" )

	req = urllib2.Request(url)
	req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2')
	response = urllib2.urlopen(req)
	page=response.read()
	response.close()
	
	try:
	    if "67DABFBF-D0AB-41fa-9C46-CC0F21721616" in page:
		link = re.compile('src="(http://[^"]*.avi)"').findall(page)[0]
		return ("got",link,'','','','','dataup')   

	except:
	    return ("fail",'','','','','','dataup')
	
def get_link2(param,code):
		return ("got",param,'','','','','dataup')